import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Register from '../views/Register.vue'
import Login from '../views/Login.vue'
import Shopping from '../views/Shopping.vue'
import Order from '../views/Order.vue'
import Hard from '../views/Hard.vue'
import Detail from '../views/Detail.vue'

Vue.use(VueRouter)

const routes = [

  {
    path:'/detail/:hid',
    name:'detail',
    component:Detail,
  },
  {
    path:'/hard',
    name:'hard',
    component:Hard
  },
  {
    path:'/order/:o_id',
    name:'order',
    component:Order,
    props:true
  },
  {
    path:'/shopping',
    name:'shopping',
    component:Shopping
  },
  {
    path:'/login',
    name:'login',
    component:Login
  },
  {
    path:'/register',
    name:'register',
    component:Register
  },
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
